package org.fast.easy.framework.web.core;

import jakarta.servlet.http.HttpServletRequest;
import org.springframework.boot.web.servlet.error.ErrorController;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author Administrator
 * org.springframework.boot.autoconfigure.web.servlet.error.BasicErrorController
 */
@RestController
public class CustomErrorController implements ErrorController {


    @RequestMapping("/error")
    @ResponseBody
    public String handleError(HttpServletRequest request) {
        // 这里可以添加自定义的错误处理逻辑
        return "{\"message\":\"服务器异常，未知错误请联系管理员\"}";
    }
}
